<?php

/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    return redirect('index.html');
});

Route::any('getAbout','AboutController@getAbout');
Route::any('test','AboutController@index');

Route::any('login','AdminController@login');

Route::any('selectCategoriesList','CategoriesController@selectCategoriesList');
Route::any('searchCategories','CategoriesController@searchCategories');

Route::any('addMessage','MessageController@addMessage');

Route::any('searchArticle','ArticleController@searchArticle');
Route::any('selectArticleList','ArticleController@selectArticleList');


Route::group(['middleware' => ['adminLoginCheck']],function (){


    Route::any('addAdmin','AdminController@addAdmin');
    Route::any('deleteAdmin','AdminController@deleteAdmin');
    Route::any('searchAdmin','AdminController@searchAdmin');
    Route::any('updateAdmin','AdminController@updateAdmin');
    Route::any('selectAdminList','AdminController@selectAdminList');

    Route::any('updateAbout','AboutController@updateAbout');


    Route::any('addCategories','CategoriesController@addCategories');
    Route::any('deleteCategories','CategoriesController@deleteCategories');
    Route::any('updateCategories','CategoriesController@updateCategories');


    Route::any('deleteMessage','MessageController@deleteMessage');
    Route::any('searchMessage','MessageController@searchMessage');
    Route::any('selectMessageList','MessageController@selectMessageList');


    Route::any('addArticle','ArticleController@addArticle');
    Route::any('deleteArticle','ArticleController@deleteArticle');
    Route::any('updateArticle','ArticleController@updateArticle');
});

Route::any('categoriesImg','ImgUploadController@categoriesImg');
Route::any('getImage','ImgUploadController@getImage');
Route::any('sendRegisterEmail','UserController@sendRegisterEmail');
Route::any('register','UserController@register');
Route::any('userLogin','UserController@login');





/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/

Route::group(['middleware' => ['web']], function () {
    //
});
